<?php

use Biz\service\TradeMsg;

class SendAction extends QueueActionPlugin
{
    public function main()
    {
        $msgCode = $this->getRequest()->getPost("msgCode");
        $to_uid = $this->getRequest()->getPost("to_uid");
        $msgParams = $this->getRequest()->getPost("msgParams");
        if (isset($to_uid) && isset($msgCode)) {
            TradeMsg::addMsg($msgCode, $to_uid, $msgParams);
            $this->setSuccess();
        } else {
            throw new \Exception("参数错误", self::CODE_NOT_RETRY);
        }
    }
}